#   不使用for来迭代所有的元素

def manual_iter():
    with open('passwd.txt') as f:
        try:
            while True:
                line = next(f)
                print(line,end='')
        except StopIteration:
            print('END')

def manual_iter2():
    with open('passwd.txt') as f:
        while True:
            line = next(f,None) #加入默认值为None
            if line is None:
                break
            print(line,end='')
item = ['1','4','6']
it = iter(item)
print(next(it))
print(next(it))
print(next(it))
if __name__ == '__main__':
    #manual_iter2()
    pass